<template>
  <div class="statis-total-info" v-if="sections">
    <div class="section" v-for="(section, idx) in sections" :key="idx">
      <div class="section-title">{{ section.title }}</div>
      <div class="field-items">
        <div class="field-item" v-for="item in section.infos" :key="item.label">
          <div class="field-label">
            {{ item.label }}
            <el-popover v-if="item.tips" placement="top-start" width="200" trigger="hover" :content="item.tips">
              <i class="el-icon-question" slot="reference"></i>
            </el-popover>
          </div>
          <div class="field-value" :style="{ color: item.color }">
            {{ item.value }}
            <el-tooltip v-if="item.sub" :content="item.sub">
              <i class="el-icon-warning"></i>
            </el-tooltip>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'StatisTotalInfo',
  components: {},
  props: {
    sections: {
      type: Array,
    },
  },
  data() {
    return {}
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {},
}
</script>
<style lang="scss" scoped>
.statis-total-info {
  display: flex;
  padding: 20px;
  .section {
    flex: 1;
    padding: 12px 20px;
    // margin-right: 20px;

    &:first-child {
      margin-right: 20px;
    }
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    .section-title {
      font-size: 18px;
      font-weight: bold;
    }
    .field-items {
      display: flex;
      margin-top: 16px;
      .field-item {
        flex: 1;
        color: #444;
        font-size: 16px;
        .field-label {
          i {
            margin-left: 5px;
            display: inline-block;
            color: #999;
            cursor: pointer;
            &:hover {
              color: #2c63b0;
            }
          }
        }
        .field-value {
          color: #333;
          font-weight: bold;
          margin-top: 10px;
          font-size: 18px;
        }
      }
      .el-icon-warning {
        color: #e6a23c;
      }
    }
  }
}
</style>
